package com.qianfeng.taoyuan.volleyDemo;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.PagerAdapter;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

/**
 * Created by Administrator on 2015/8/3.
 */
public class TestAdapter extends FragmentPagerAdapter {

    private final MyFragment[] myFragmnets;

    public TestAdapter(FragmentManager fm,MyFragment[] myFragments) {
        super(fm);
        this.myFragmnets = myFragments;
    }

    @Override
    public Fragment getItem(int position) {
        return myFragmnets[position];
    }

    @Override
    public int getCount() {
        return myFragmnets!=null&&myFragmnets.length>0?myFragmnets.length:0;
    }
}
